package com.example.administrator.fragarmentdemotest_a.fragarment_demo.adapter;

import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.example.administrator.fragarmentdemotest_a.utils.app.BaseFragment;

public class PagerContactAdapter extends FragmentPagerAdapter {

    private BaseFragment[] frags;
    private String[] tbtxt;

    public PagerContactAdapter(FragmentManager fm, BaseFragment[] frags, String[] tbtxt) {
        super(fm);
        this.frags = frags;
        this.tbtxt = tbtxt;
    }

    @Override
    public Fragment getItem(int position) {
        return frags[position];
    }

    @Override
    public int getCount() {
        return frags.length;
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return tbtxt[position];
    }
}
